import request from './request.js'
/**
 * 服务端api封装
 */
let api = {
    get: (url, data) => {
        return new Promise((resolve, reject) => {
			
            request({
                url: url,
                params: data,
                method: 'get'
            }).then((res) => {
                resolve(res);
            }).catch((err) => {
                reject(err);
            })
        })
    },
    post: (url, data) => {
        return new Promise((resolve, reject) => {
            request({
                url: url,
                method: "POST",
                data: data
            }).then((res) => {
                resolve(res);
            }).catch((err) => {
                reject(err);
            })
        })
    }
};
export default api;